package com.wayne.cas.login;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apereo.cas.authentication.UsernamePasswordCredential;

import javax.validation.constraints.Size;

public class UsernamePasswordKaptchaCredential extends UsernamePasswordCredential {

  @Size(min = 4, max = 4, message = "require kaptcha")
  private String kaptcha;

  public String getKaptcha() {
    return kaptcha;
  }

  public UsernamePasswordKaptchaCredential setKaptcha(String kaptcha) {
    this.kaptcha = kaptcha;
    return this;
  }

  @Override
  public int hashCode() {
    return new HashCodeBuilder()
        .appendSuper(super.hashCode())
        .append(this.kaptcha)
        .toHashCode();
  }
}